package com.aquarium.util;

import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;

import com.aquarium.R;
import com.aquarium.ui.SensorValueDisplayActivity;

public class DialogUtils {
	public static void show(final Context context, String[] events) {
		AlertDialog.Builder builder = new AlertDialog.Builder(context);
		builder.setTitle(R.string.sensor_value_err).setItems(events,
				new DialogInterface.OnClickListener() {
					public void onClick(DialogInterface dialog, int which) {
						// The 'which' argument contains the index position
						// of the selected item
					}
				});
		builder.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
	           public void onClick(DialogInterface dialog, int id) {
	               // User clicked OK button
	        	   Intent intent = new Intent();
	   			intent.setClass(context,
	   					SensorValueDisplayActivity.class);
	   			context.startActivity(intent);
	           }
	       });
		builder.create().show();
	}

}
